﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IceTrigger : MonoBehaviour {

    public float duration = 0.6f;

    private void OnTriggerExit2D(Collider2D collision) {
        var player = collision.GetComponentInParent<CharacterData>();
        if (player == null) {
            return;
        }

        player.iceTrigger = null;
    }

    private void OnTriggerEnter2D(Collider2D collision) {
        var player = collision.GetComponentInParent<CharacterData>();
        if (player == null) {
            return;
        }

        player.iceMoveDuration = duration; 
        player.iceTriggerCheck = true;
        player.iceTrigger = this;
    }


}
